from pydantic_settings import BaseSettings, SettingsConfigDict
from enum import Enum


class StorageType(Enum):
    MINIO = "minio"
    OBS = "obs"


class Config(BaseSettings):
    model_config = SettingsConfigDict(
        env_file=".env", env_ignore_empty=True, extra="ignore"
    )

    ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
    ALGORITHM: str = "HS256"
    SECRET_KEY: str = "nwnwinv2+_weg][34534080$%^&&"

    # postgresql相关配置
    POSTGRESQL_URI: str

    STORAGE_TYPE: StorageType
    # Minio相关配置
    MINIO_ENDPOINT: str
    MINIO_ACCESS_KEY: str
    MINIO_SECRET_KEY: str
    MINIO_BUCKET_NAME: str
    # dify相关配置
    DIFY_DOMAIN: str
    DIFY_API_KEY: str


settings = Config()
